package com.tuoke.feign;

import com.tuoke.feign.fallback.UserFeignServiceFallback;
import com.tuoke.pojo.User;
import com.tuoke.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "user-service", fallback = UserFeignServiceFallback.class)
public interface UserFeignService {
    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable("userId")  Integer userId);

    @GetMapping("/{userId}/score")
    JsonResult addScore(@PathVariable("userId") Integer userId, @RequestParam("score") Integer score);
}
